#include<iostream>

class Message
{
    public:
        void play()
        {
            std::cout<<"发短信\n";
        }
};
class phone
{
public:
    void play()
    {
        std::cout<<"打电话"<<std::endl;
    }
    void sendMessage()
    {
            m.play;
    }

private:
    Message m;//将一个类的对象塞入另一个类中

};

class Game
{
    public:
        void play()
        {
            std::cout<<"玩游戏"<<std::endl;
        }
};

class Smartphone:public phone,public Game//多继承：一个子类有多个父类
{


};
//多重继承：子类的父类仍有父类：间接基类
int main()
{
    Smartphone s;
    s.phone::Message::play();//二义性问题(多个父类函数有重名)
    s.sendMessage();
    return 0;
}